home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / networ1a / whois.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-07-16  |  4.0 KB  |  121 lines

  1. VERSION 5.00
  2. Object = "{FFACF7F3-B868-11CE-84A8-08005A9B23BD}#1.7#0"; "DSSOCK32.OCX"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "WhoIs Example"
  6.    ClientHeight    =   3885
  7.    ClientLeft      =   1140
  8.    ClientTop       =   1515
  9.    ClientWidth     =   5775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    PaletteMode     =   1  'UseZOrder
  14.    ScaleHeight     =   3885
  15.    ScaleWidth      =   5775
  16.    ShowInTaskbar   =   0   'False
  17.    Begin VB.CommandButton Command1 
  18.       Caption         =   "Proccess Request"
  19.       Height          =   255
  20.       Left            =   2040
  21.       TabIndex        =   4
  22.       Top             =   3600
  23.       Width           =   1455
  24.    End
  25.    Begin VB.TextBox text2 
  26.       Height          =   285
  27.       Left            =   1920
  28.       TabIndex        =   2
  29.       Text            =   "hackers.com"
  30.       Top             =   0
  31.       Width           =   3855
  32.    End
  33.    Begin VB.TextBox Text1 
  34.       Height          =   3135
  35.       Left            =   0
  36.       MultiLine       =   -1  'True
  37.       ScrollBars      =   2  'Vertical
  38.       TabIndex        =   1
  39.       Top             =   360
  40.       Width           =   5775
  41.    End
  42.    Begin dsSocketLib.dsSocket dsSocket1 
  43.       Height          =   420
  44.       Left            =   4080
  45.       TabIndex        =   0
  46.       Top             =   3480
  47.       Width           =   420
  48.       _Version        =   65543
  49.       _ExtentX        =   741
  50.       _ExtentY        =   741
  51.       _StockProps     =   64
  52.       LocalPort       =   31337
  53.       RemoteHost      =   "whois.internic.net"
  54.       RemotePort      =   43
  55.       ServiceName     =   ""
  56.       RemoteDotAddr   =   ""
  57.       Linger          =   -1  'True
  58.       Timeout         =   10
  59.       LineMode        =   0   'False
  60.       EOLChar         =   10
  61.       BindConnect     =   0   'False
  62.       SocketType      =   0
  63.    End
  64.    Begin VB.Label Label1 
  65.       BackStyle       =   0  'Transparent
  66.       Caption         =   "Domain name to look up:"
  67.       Height          =   255
  68.       Left            =   0
  69.       TabIndex        =   3
  70.       Top             =   0
  71.       Width           =   1815
  72.    End
  73. Attribute VB_Name = "Form1"
  74. Attribute VB_GlobalNameSpace = False
  75. Attribute VB_Creatable = False
  76. Attribute VB_PredeclaredId = True
  77. Attribute VB_Exposed = False
  78. Dim lByteCount As Long
  79. Private Sub Command1_Click()
  80.     '   use the whois server known as rs4.internic.net
  81.     '   clear any previous query results first
  82.     Text1 = ""
  83.     '   clear the byte count
  84.     lByteCount = 0
  85.     dsSocket1.RemoteHost = "whois.internic.net"
  86.     '   whois servers await us on port 43  ;]
  87.     dsSocket1.RemotePort = 43
  88.     '   well alrighty kids, its time to connect.
  89.     dsSocket1.Connect
  90. End Sub
  91. Private Sub dsSocket1_Connect()
  92. On Error Resume Next
  93.     ' send the name of the domain we want to get
  94.     ' the info or what ever on.
  95.     dsSocket1.Send = Text2 & vbCrLf
  96. End Sub
  97. Private Sub dsSocket1_Exception(ErrorCode As Integer, ErrorDesc As String)
  98. MsgBox ErrorDesc
  99. End Sub
  100. Private Sub dsSocket1_Receive(ReceiveData As String)
  101. On Error Resume Next
  102.     Dim strData     As String
  103.     '   save the incoming data
  104.     strData = ReceiveData
  105.     '   count the bytes
  106.     lByteCount = lByteCount + Len(strData)
  107.     '   the incoming data stream uses only LF characters
  108.     '   to denote a line wrap (ala Unix) so we'll precede
  109.     '   them with a CR so that the standard VB textbox will
  110.     '   wrap the lines correctly
  111.     While InStr(strData, Chr(10)) > 0
  112.         Text1 = Text1 & Left(strData, InStr(strData, Chr(10)) - 1) & Chr(13) & Chr(10)
  113.         strData = Mid(strData, InStr(strData, Chr(10)) + 1)
  114.     Wend
  115.     '   if there's anything left then add it to the textbox
  116.     Text1 = Text1 & strData
  117.     dsSocket1.Close
  118. End Sub
  119. Private Sub dsSocket1_SendReady()
  120. End Sub
  121.